package com.itheima;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
       //开启线程的第一种方法
        /* MyThead t1=new MyThead();
        MyThead t2=new MyThead();
        t1.start();
        t2.start();*/
        //开启线程的第二种方法
        MyRunnable mr=new MyRunnable();
        Thread t=new Thread(mr);
        t.start();
        MyRunnable mr1=new MyRunnable();
        Thread t1=new Thread(mr1);
        t1.start();
      //开启线程的第三种方法
       /* MyCallable mc=new MyCallable();
        FutureTask<String> ft=new FutureTask(mc);
        Thread t1=new Thread(ft);
        t1.start();
        String s = ft.get();
        System.out.println(s);*/
    }
}
